Skip to contentSkip to conversation

Change in openvpn[master]: Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp

Openvpn-devel In review flichtenheld (Code Review) 2 participants 7 messages Apr 10, 2024 – May 2, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1712744941000.Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/553?usp=email

to review the following change.

Change subject: Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp
......................................................................

Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp

Both values are boolean so there is no reason to use "|" and it just confuses the reader whether there is something more going on here.

Change-Id Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e

---
M src/openvpn/helper.c
M src/openvpn/init.c

2 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/53/553/1

src/openvpn/helper.c +1 -1
index 1bab84c..24dee97 100644
@@ -427,7 +427,7 @@
      * if !nogw:
      *   push "route-gateway dhcp"
      */
-    else if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    else if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         if (o->client)
         {
src/openvpn/init.c +1 -1
index 02205e7..e67f10e 100644
@@ -3565,7 +3565,7 @@
         msg(M_WARN, "WARNING: using --pull/--client and --ifconfig together is probably not what you want");
     }
 
-    if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         msg(M_WARN, "NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to");
     }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/553?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e
Gerrit-Change-Number: 553
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/553?usp=email )

Change subject: Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp
......................................................................

Patch Set 1: Code-Review-1

(1 comment)

Patchset:

PS1:
I find the change very logical, but I'm a bit confused why all my buildbots failed - and I can't seem to make any sense out of the error output...

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/553?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e
Gerrit-Change-Number: 553
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Wed, 01 May 2024 20:20:16 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/553?usp=email )

Change subject: Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp
......................................................................

Patch Set 1: Code-Review+2

(2 comments)

Patchset:

PS1:

Quoted 1 line

I find the change very logical, but I'm a bit confused why all my buildbots failed - and I can't see […]

Done

PS1:
patch looks good, and buildbot fail reason has been clarified (external infrastructure)

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/553?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e
Gerrit-Change-Number: 553
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Thu, 02 May 2024 08:49:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment

#4 lore raw

PATCH 1/1 Fix "binary or" vs "boolean or" related to server_bridge_proxy_dhcp

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Both values are boolean so there is no reason to use "|" and it just confuses the reader whether there is something more going on here.

Change-Id Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/553
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/helper.c +1 -1
index 1bab84c..24dee97 100644
@@ -427,7 +427,7 @@
      * if !nogw:
      *   push "route-gateway dhcp"
      */
-    else if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    else if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         if (o->client)
         {
src/openvpn/init.c +1 -1
index 02205e7..e67f10e 100644
@@ -3565,7 +3565,7 @@
         msg(M_WARN, "WARNING: using --pull/--client and --ifconfig together is probably not what you want");
     }
 
-    if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         msg(M_WARN, "NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to");
     }
#5 lore raw

[Openvpn-devel] [PATCH applied] Re: Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

Code looks good, old code happened to work but was "logically wrong", so this is a reasonable fix. As it's not really a *bug* I've kept it to master.

Tested on the server test rig, for good measure, though that one doesn't actually have a --server-bridge config - the TAP server test uses VLANs and scripts to do IP-and-VLAN assignments... meh.

Your patch has been applied to the master branch.

commit 9d92221eb4e773cae913752af6d70082ae305fe8

Author: Frank Lichtenheld
Date:   Thu May 2 11:53:22 2024 +0200
     Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg28601.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#6 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/553?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp
......................................................................

Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

Both values are boolean so there is no reason to use "|" and it just confuses the reader whether there is something more going on here.

Change-Id Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28601.html

---
M src/openvpn/helper.c
M src/openvpn/init.c

2 files changed, 2 insertions(+), 2 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/53/553/2

src/openvpn/helper.c +1 -1
index 5681718..bbdbc04 100644
@@ -454,7 +454,7 @@
      * if !nogw:
      *   push "route-gateway dhcp"
      */
-    else if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    else if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         if (o->client)
         {
src/openvpn/init.c +1 -1
index 02205e7..e67f10e 100644
@@ -3565,7 +3565,7 @@
         msg(M_WARN, "WARNING: using --pull/--client and --ifconfig together is probably not what you want");
     }
 
-    if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         msg(M_WARN, "NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to");
     }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/553?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e
Gerrit-Change-Number: 553
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#7 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/553?usp=email )

Change subject: Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp
......................................................................

Fix 'binary or' vs 'boolean or' related to server_bridge_proxy_dhcp

Both values are boolean so there is no reason to use "|" and it just confuses the reader whether there is something more going on here.

Change-Id Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg28601.html

---
M src/openvpn/helper.c
M src/openvpn/init.c

2 files changed, 2 insertions(+), 2 deletions(-)
src/openvpn/helper.c +1 -1
index 5681718..bbdbc04 100644
@@ -454,7 +454,7 @@
      * if !nogw:
      *   push "route-gateway dhcp"
      */
-    else if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    else if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         if (o->client)
         {
src/openvpn/init.c +1 -1
index 02205e7..e67f10e 100644
@@ -3565,7 +3565,7 @@
         msg(M_WARN, "WARNING: using --pull/--client and --ifconfig together is probably not what you want");
     }
 
-    if (o->server_bridge_defined | o->server_bridge_proxy_dhcp)
+    if (o->server_bridge_defined || o->server_bridge_proxy_dhcp)
     {
         msg(M_WARN, "NOTE: when bridging your LAN adapter with the TAP adapter, note that the new bridge adapter will often take on its own IP address that is different from what the LAN adapter was previously set to");
     }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/553?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie61fa6a78875ecbaa9d3d8e7a50603d77c9ce09e
Gerrit-Change-Number: 553
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged